package com.gitee.ly.ymorm.executor;

import com.gitee.ly.ymorm.mapping.ParamMap;
import com.gitee.ly.ymorm.mapping.YmOrmStatement;
import com.gitee.ly.ymorm.transaction.Transaction;

import java.sql.SQLException;
import java.util.List;

/**
 * Executor
 *
 * @author ly
 **/
public interface Executor {

    <E> List<E> query(YmOrmStatement ymOrmStatement, ParamMap paramMap, Class<? extends E> resultType) throws SQLException;

    int update(YmOrmStatement ymOrmStatement, ParamMap paramMap) throws SQLException;

    void commit(boolean required) throws SQLException;

    void rollback(boolean required) throws SQLException;

    Transaction getTransaction();

    void close(boolean forceRollback);

    boolean isClosed();
}
